package com.ryskoo.common.hclconstant;

/**
 * 支付类型
 *
 * @author BeHappy
 */
public enum PayTypeEnum {
    OFFLINE(1, "线下支付"),
    ALIPAY(2, "支付宝支付"),
    WECHATPAY(3, "微信支付"),
    UNIONPAY(4, "银联支付");

    private int value;
    private String name;

    PayTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (PayTypeEnum o : PayTypeEnum.values()) {
            if (o.getValue() == value) {
                return o.getName();
            }
        }
        return "";
    }
}
